#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    int rearrangeCharacters(string s, string target)
    {
        unordered_map<char, int> ms;
        unordered_map<char, int> mt;

        for (auto &c : target)
        {
            mt[c]++;
        }

        for (auto &c : s)
        {
            ms[c]++;
        }

        int ans = 101;

        for (auto &c : target)
        {
            ans = min(ans, ms[c]/mt[c]);
        }

        return ans;
    }
};

int main(int argc, char const *argv[])
{
    /* code */
    return 0;
}
